package http;

import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

/**
 * @time: 2019/11/29 13:14
 * @author: baozi
 *
 *
 */
public class tcpClient {

    public static void main(String[] args) {
        try {
            Socket s=new Socket("127.0.0.1",6666);
            OutputStream o=s.getOutputStream();
            o.write("发你".getBytes());
            InputStream is=s.getInputStream();
            byte[] b=new byte[1024];
            is.read(b);
            System.out.println(new String(b));
            s.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
